import Cookies from 'js-cookie'

const TokenKey = 'Admin-Token'
export function getToken () {
  return Cookies.get(TokenKey)
}

export function setToken (token) {
  // const seconds = 60
  const seconds = 20000
  const expires = new Date(new Date() * 1 + seconds * 1000)
  return Cookies.set(TokenKey, token, { expires: expires })
}

export function removeToken () {
  return Cookies.remove(TokenKey)
}
